home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue24 / z_prof / Z_PROF.ZIP / z_demo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-07-03  |  1.3 KB  |  57 lines

  1. unit z_demo;
  2.  
  3. interface
  4.  
  5. uses
  6.   z_prof,Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Button1: TButton;
  12.     Button2: TButton;
  13.     fsin: TButton;
  14.     fmul: TButton;
  15.     fdiv: TButton;
  16.     fadd: TButton;
  17.     Label1: TLabel;
  18.     procedure FormCreate(Sender: TObject);
  19.     procedure faddClick(Sender: TObject);
  20.   private
  21.     { Private declarations }
  22.   public
  23.   mprof:tzprofiler;
  24.     { Public declarations }
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33. const aa:extended=0;
  34. procedure TForm1.FormCreate(Sender: TObject);
  35. begin
  36. mprof:= tzprofiler.create(self);
  37. end;
  38.  
  39. procedure TForm1.faddClick(Sender: TObject);
  40. var tt:dword;
  41. begin
  42. with profile , tcontrol(sender) do
  43. case tag of
  44.      1: begin mark(tag,true);sleep(100);mark(tag,false);end;
  45.      2: begin mark(tag,true);
  46.               tt:=gettickcount;while tt= gettickcount do;
  47.               while gettickcount<(tt+101) do;
  48.               mark(tag,false);end;
  49.      3: begin mark(tag,true);aa:=3.14+3.14;mark(tag,false);end;
  50.      4: begin mark(tag,true);aa:=3.14*3.14;mark(tag,false);end;
  51.      5: begin mark(tag,true);aa:=3.14/3.14;mark(tag,false);end;
  52.      6: begin mark(tag,true);aa:=sin(3.14);mark(tag,false);end;
  53.      end;
  54. end;
  55.  
  56. end.
  57.